package com.bobo.pojo;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;

/**
 * 定时任务
 *
 * @author LILIBO
 * @since 2023-02-18
 */
@Tag(name = "定时任务")
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_job")
public class SysJob implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 定时任务ID
     */
    @Schema(name = "定时任务ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 任务名称
     */
    @Schema(name = "任务名称")
    private String jobName;

    /**
     * 任务分组
     */
    @Schema(name = "任务分组")
    private String jobGroup;

    /**
     * 目标任务（支持Bean调用、Class类调用，例如：@Component("taskJob") 则目标任务字符串为：taskJob.taskParams('hello')）
     */
    @Schema(name = "目标任务")
    private String invokeTarget;

    /**
     * 定时器cron表达式
     */
    @Schema(name = "定时器cron表达式")
    private String cronExpression;

    /**
     * 任务描述
     */
    @Schema(name = "任务描述")
    private String remark;

    /**
     * 任务运行状态 0:停止;1:启动
     */
    @Schema(name = "任务运行状态 0:停止;1:启动")
    private Integer status;

    /**
     * 定时任务创建时间
     */
    @Schema(name = "定时任务创建时间")
    private String createTime;

    /**
     * 定时任务修改时间
     */
    @Schema(name = "定时任务修改时间")
    private String modifyTime;

    public SysJob(String jobName, String jobGroup, String invokeTarget, String cronExpression, String remark, Integer status) {
        this.jobName = jobName;
        this.jobGroup = jobGroup;
        this.invokeTarget = invokeTarget;
        this.cronExpression = cronExpression;
        this.remark = remark;
        this.status = status;
    }

}
